﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TransCode.Player.Controls
{
    /// <summary>
    /// Interaction logic for MenuButton.xaml
    /// </summary>
    public partial class MenuButton : UserControl, IFuncChange
    {
        public MenuButton()
        {
            InitializeComponent();
        }

        public void Change(FuncEnum func)
        {
            switch (func)
            {
                case FuncEnum.Image:
                    if (!rbImage.IsChecked.Value)
                        rbImage.IsChecked = true;
                    break;
                case FuncEnum.VideoList:
                    if (!rbVideoList.IsChecked.Value)
                        rbVideoList.IsChecked = true;
                    break;
                case FuncEnum.VideoPlay:
                    if (!rbVideo.IsChecked.Value)
                        rbVideo.IsChecked = true;
                    break;
            }
        }

        private void rbVideo_Click(object sender, RoutedEventArgs e)
        {
            Common.Change(FuncEnum.VideoPlay);
        }

        private void rbImage_Click(object sender, RoutedEventArgs e)
        {
            Common.Change(FuncEnum.Image);
        }

        private void rbVideoList_Click(object sender, RoutedEventArgs e)
        {
            Common.Change(FuncEnum.VideoList);
        }
    }
}
